package com.wyp168.newcode.face.problem;

import java.util.Random;

/**
 * @ClassName javase
 * @Title TODO
 * @Description TODO
 * @Author wyp168
 * @Date 2023/2/5 11:18
 */
public class AObject {
    public Long id;
    protected boolean isTrue;
    private Random random = new Random();
    private String message = "this is a test data.";

    public AObject() {
    }

    public AObject(Long id, boolean isTrue, Random random, String message) {
        this.id = id;
        this.isTrue = isTrue;
        this.random = random;
        this.message = message;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public boolean isTrue() {
        return isTrue;
    }

    public void setTrue(boolean aTrue) {
        isTrue = aTrue;
    }

    public Random getRandom() {
        return random;
    }

    public void setRandom(Random random) {
        this.random = random;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String methodA() {
        try {
            return Class.forName("com.wyp168.newcode.face.problem.AObject").getName();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return "无法使用反射获取到相关类名";
    }

    protected int methodB() {
        return this.random.nextInt();
    }

    private boolean methodC() {
        isTrue = !isTrue;
        return isTrue;
    }

}
